<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./vue.js"></script>
    <style>
      .fade-enter-active,
      .fade-leave-active {
        transition: opacity 10s;
      }
      .fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
        opacity: 0;
      }

      .slide-enter {
        transform: translateX(200px);
        opacity: 0;
      }
      .slide-enter-active,
      .slide-leave-active {
        transition: all 3s;
      }
      /* .slide-enter-to {
        transform: translateX(0px);
      } */

      .slide-leave-to {
        transform: translateY(200px);
        opacity: 0;
      }

      .donghua-enter-active {
        animation: my-donghua 3s;
      }
      @keyframes my-donghua {
        from {
          transform: translateX(200px);
          opacity: 0;
        }
        to {
          transform: translateX(0px);
          opacity: 1;
        }
      }
      .donghua-leave-active {
        animation: my-leave 3s;
      }
      @keyframes my-leave {
        0% {
          transform: scale(1);
        }
        20% {
          transform: scale(1.2);
        }
        100% {
          transform: scale(0);
        }
      }
    </style>
  </head>
  <body>
    <div id="app">
      <button @click="seen = !seen">toggle</button>
      <!-- <transition name="fade">
        <div
          v-if="seen"
          style="width: 100px; height: 100px; background-color: red"
        ></div>
      </transition> -->

      <!-- <transition name="slide">
        <div
          v-if="seen"
          style="width: 100px; height: 100px; background-color: red"
        ></div>
      </transition> -->

      <transition name="donghua">
        <div
          v-if="seen"
          style="width: 100px; height: 100px; background-color: red"
        ></div>
      </transition>
    </div>
    <script>
      new Vue({
        el: "#app",
        data: {
          seen: false,
        },
      });
    </script>
  </body>
</html>
